
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author  John Miller
 *  @version 1.1
 *  @date    Fri Dec 27 15:41:58 EST 2013
 *  @see     LICENSE (MIT style license file).
 */

package apps.tableau

import scalation.model.TimeUnits._
import scalation.random.Exponential
import scalation.tableau.Model

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** The `Bank` class defines a simple tableau model of a Bank where service is
 *  provided by one teller and models an M/M/1 queue.
 */
object Bank extends App
{
    val stream     = 1                                      // random number stream to use (0 to 99)
    val lambda     = 6.0                                    // customer arrival rate (per hour)
    val mu         = 7.5                                    // customer service rate (per hour)
    val maxCusts   = 10                                     // stopping rule: simulate maxCustss customers
    val iArrivalRV = Exponential (HOUR/lambda, stream)      // inter-arrival time random variate
    val serviceRV  = Exponential (HOUR/mu, stream)          // service time random variate
    val label      = Array ("ID-0", "IArrival-1", "Arrival-2", "Start-3", "Service-4", "End-5", "Wait-6", "Total-7")
    val mm1 = new Model ("M/M/1 Queue", maxCusts, Array (iArrivalRV, serviceRV), label)
    mm1.simulate ()
    mm1.report

} // Bank

